<?php
/**
 *Abstract Controller
 *
 *@author S.Feil, T.Ziegler, M.El-Hindi <goatymail@googlemail.com>
 *27 May 2012
 *@copyright Copyright (c) 2012, S.Feil, T.Ziegler, M.El-Hindi
 *@package cms
 *
 */
/**
 * Abstract Class Controller
 * every controller inherits from this class
 *
 *@package lib
 */
abstract class Controller{
    /**
     * holds reference to viewmanager
     * @var object
     */
    protected $oViewmanager;

    /**
     * Array that holds the parameter that are passed to the controller
     * @var array
     */
    protected $aArgs = array();

    /**
     * Controller Constructor
     * gets viewmanager instance
     */
    public function __construct(){
        $this->oViewmanager = Viewmanager::getInstance();
    }

    /**
     * Setter-Method for $this->aArgs
     * @param array $aArgs Parameters that are passed to the controller
     */
    public function _setArgs($aArgs){
        $this->aArgs = $aArgs;
    }


    /**
     * Every controller must provide a function to check the arguments
     *
     * @param Array $aArgs
     */
    public abstract function checkArgs($aArgs);

    /**
     * Runs a controller and makes him retrive data from database
     * @param array $aArgs Parameters passed to the execution circle of the controller
     */
    public abstract function execute($aArgs);
}
?>